<template>
  <div class="theory-container">
    <div class="title">
      <hr class="hr" />
      <div class="title-text">2024小车理论考试</div>
    </div>
    <div class="boxs">
      <div class="box">
        <div class="box-title">
          <div class="box-container">
            <div class="icon">
              <Icon type="ybp" />
            </div>
            <div class="icon-title"><p>科目一交规</p></div>
          </div>
        </div>
        <div class="box-content">
          <div v-for="item in obj1" class="exam">
            <div class="exam-icon"><Icon :type="item.type" /></div>
            <div class="ctx">
              <div class="ctx-title">
                <p>{{ item.title }}</p>
              </div>
              <div class="ctx-des">
                <p>{{ item.description }}</p>
              </div>
            </div>
          </div>
        </div>
        <div class="btn"><button>模拟考试</button></div>
      </div>
      <div class="box">
        <div class="box-title">
          <div class="box-container">
            <div class="icon">
              <Icon type="ybp" />
            </div>
            <div class="icon-title"><p>科目四交规</p></div>
          </div>
        </div>
        <div class="box-content">
          <div v-for="item in obj1" class="exam">
            <div class="exam-icon"><Icon :type="item.type" /></div>
            <div class="ctx">
              <div class="ctx-title">
                <p>{{ item.title }}</p>
              </div>
              <div class="ctx-des">
                <p>{{ item.description }}</p>
              </div>
            </div>
          </div>
        </div>
        <div class="btn"><button>模拟考试</button></div>
      </div>
    </div>
  </div>
</template>

<script setup>
import Icon from "./Icon.vue";
const obj1 = [
  {
    title: "顺序练习",
    type: "xh",
    description: "按照顺序练习做题",
  },
  {
    title: "随机练习",
    type: "jt",
    description: "按照随机顺序做题",
  },
  {
    title: "专项练习",
    type: "ybp",
    description: "分门别类重点突破",
  },
  {
    title: "难题攻克",
    type: "bz",
    description: "准确把握考试难点",
  },
];
const obj4 = [
  {
    title: "顺序练习",
    type: "xh",
    description: "按照顺序练习做题",
  },
  {
    title: "随机练习",
    type: "jt",
    description: "按照随机顺序做题",
  },
  {
    title: "专项练习",
    type: "ybp",
    description: "分门别类重点突破",
  },
  {
    title: "难题攻克",
    type: "bz",
    description: "准确把握考试难点",
  },
];
</script>

<style scoped>
.btn button {
  padding: 10px 120px;
  font-size: 18px;
  line-height: 1.5;
  background-color: rgb(37, 166, 251);
  border-radius: 5px;
  color: white;
  border: none;
  cursor: pointer;
}

.btn {
  margin: 0 auto;
  width: fit-content;
  margin-top: 50px;
}

.box-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  justify-items: center;
}

.ctx {
  width: auto;
  height: fit-content;
}

.ctx-title p {
  font-size: 18px;
}

.ctx-des p {
  font-size: 14px;
  color: rgb(107, 107, 107);
}

.ctx-title p:hover {
  color: rgb(0, 201, 246);
  cursor: pointer;
}

.exam {
  background-color: rgb(235, 235, 235);
  width: 250px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exam-icon {
  font-size: 36px;
  height: fit-content;
  margin-right: 10px;
}

.hr {
  width: 90%;
  height: 2px;
  border: none;
  border-top: 1px dotted #e9e9e9;
}

.box-title {
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.box-container {
  display: flex;
  height: fit-content;
}

.icon {
  font-size: 30px;
  width: 36px;
}

.icon-title {
  width: 100%;
  font-size: 20px;
  text-align: center;
  line-height: 40px;
}

.icon-title p:hover {
  color: rgb(0, 201, 246);
  cursor: pointer;
}

.title {
  text-align: center;
  position: relative;
  width: 100%;
  display: inline-block;
  margin-top: -20px;
  line-height: 41px;
  padding: 0 45px;
  background-color: #fff;
  font-size: 30px;
}

.title-text {
  width: fit-content;
  position: absolute;
  left: 0;
  right: 0;
  top: -20px;
  margin-left: auto;
  margin-right: auto;
  background-color: white;
}

.boxs {
  margin-top: 100px;
  width: 100%;
  display: flex;
  justify-content: space-around;
}

.box {
  width: 600px;
  height: 380px;
  border: 1px solid rgb(220, 220, 220);
}
</style>
